home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: ?? How to dump text files to screen ??
- Date: Sat, 16 Mar 96 20:17:11 GMT
- Organization: none
- Message-ID: <827007431snz@genesis.demon.co.uk>
- References: <31430CE8.469E@aol2.com> <4iddva$aic@sue.cc.uregina.ca> <4idmr2INNol@keats.ugrad.cs.ubc.ca>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4idmr2INNol@keats.ugrad.cs.ubc.ca>
- c2a192@ugrad.cs.ubc.ca "Kazimir Kylheku" writes:
-
- >There is no need to use a buffer. The putc() and getc() functions are often
- >defined as macros which operate directly and efficiently on the FILE structure,
- >calling for buffer flushes and replenishes as needed. The while() loop above is
- >probably more efficient than fgets(), and doesn't require extra buffering.
-
- Well, that's possible but if it were true it wouldn't say much for your
- compiler/system's implementation of fgets(). In the efficiency stakes though
- on most systems your best bet is fread()/fwrite() with a sensible buffer
- size (say BUFSIZ or something derived from it).
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-